/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: Hanlder.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/16 下午3:42
 * LastModified: 2020/03/16 15:42:16
 */

package com.qolome.knowledge.design.pattern.responsibilitychain.demo.authentication;


import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

/**
 * @author Qolome
 * @version V1.0
 * @Description 登录验证
 * @date 2020年 03月16日 15:42:28
 */
@Slf4j
public class AuthBaseHandler extends BaseHandler {

    @Override
    public void doHanlder(AuthenticationInfo authenticationInfo) {

        if (!StringUtils.equals(authenticationInfo.getRole(),"Admin")){
            log.warn("权限不足");
            return;
        }
        log.info("权限验证通过继续执行");
        next.doHanlder(authenticationInfo);

    }
}
